Skip to content

Conversation

@hanouticelina
Copy link
Contributor

this PR fixes a small bug when getting the task snippets to generate the inference API docs in hub-docs/scripts/api-inference/scripts/generate.ts. when generating the documentation with the latest version of huggingface/tasks, I got the following error:

if (model.tags.includes("conversational")) {
                 ^
TypeError: Cannot read properties of undefined (reading 'includes')

Changes made:

  • added optional chaining operator to the model.tags check in the snippets.

@hanouticelina
Copy link
Contributor Author

my bad 😬 tags is required and cannot be underfined, the changes will be made in hub-docs/scripts/api-inference/scripts/generate.ts. I will close this PR, sorry

@julien-c julien-c deleted the fix-optional-chaining-for-model-tags branch October 2, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants